import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { NamespaceService } from './namespace.service';
import { ResponseUtil } from '../common/utils/response.util';
@Controller('namespace')
export class NamespaceController {
  constructor(private readonly namespaceService: NamespaceService) {}
  public namespaceList: any = {
    list: [
      {
        name: 'default',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'default',
        },
        annotations: null,
      },
      {
        name: 'kube-system',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'kube-system',
        },
        annotations: null,
      },
      {
        name: 'kube-public',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'kube-public',
        },
        annotations: null,
      },
      {
        name: 'kube-node-lease',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'kube-node-lease',
        },
        annotations: null,
      },
      {
        name: 'karmada-system',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:08:09Z',
        labels: {
          'kubernetes.io/metadata.name': 'karmada-system',
        },
        annotations: null,
      },
      {
        name: 'kuboard',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:10:33Z',
        labels: {
          'kubernetes.io/metadata.name': 'kuboard',
        },
        annotations: {
          'kubectl.kubernetes.io/last-applied-configuration':
            '{"apiVersion":"v1","kind":"Namespace","metadata":{"annotations":{},"name":"kuboard"}}\n',
        },
      },
      {
        name: 'test2',
        status: 'Active',
        creationTimestamp: '2025-08-26T01:27:06Z',
        labels: {
          'kubernetes.io/metadata.name': 'test2',
        },
        annotations: null,
      },
      {
        name: 'default',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'default',
        },
        annotations: null,
      },
      {
        name: 'kube-system',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'kube-system',
        },
        annotations: null,
      },
      {
        name: 'kube-public',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'kube-public',
        },
        annotations: null,
      },
      {
        name: 'kube-node-lease',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:02:38Z',
        labels: {
          'kubernetes.io/metadata.name': 'kube-node-lease',
        },
        annotations: null,
      },
      {
        name: 'karmada-system',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:08:09Z',
        labels: {
          'kubernetes.io/metadata.name': 'karmada-system',
        },
        annotations: null,
      },
      {
        name: 'kuboard',
        status: 'Active',
        creationTimestamp: '2025-08-25T09:10:33Z',
        labels: {
          'kubernetes.io/metadata.name': 'kuboard',
        },
        annotations: {
          'kubectl.kubernetes.io/last-applied-configuration':
            '{"apiVersion":"v1","kind":"Namespace","metadata":{"annotations":{},"name":"kuboard"}}\n',
        },
      },
      {
        name: 'test2',
        status: 'Active',
        creationTimestamp: '2025-08-26T01:27:06Z',
        labels: {
          'kubernetes.io/metadata.name': 'test2',
        },
        annotations: null,
      },
    ],
    continueToken: null,
  };
  /* 
    分页查询获取命名空间列表
    @param data 查询参数，默认为空对象
    */
  @Post('/listNamespaces/:agentId')
  postNamespaceList() {
    return ResponseUtil.success(this.namespaceList);
  }
}
